<div class="modal-header">
  <button type="button" class="close" ng-click="cancel()" ><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>

  <h4 class="modal-title text-info text-lg text-center">
    <span ng-hide="parentTaskInfo">新建任务</span>
    <span ng-show="parentTaskInfo">新建子任务（父级任务：{{parentTaskInfo.label}})</span>
  </h4>
</div>
<form role="form">
  <div class="modal-body" id="create-task">

    <!-----------------------任务名----------------------->
    <div class="form-group">
      <label for="create-task-name">任务名</label>
      <input type="text" class="form-control" id="create-task-name" placeholder="请输入任务名" ng-model="taskData.name" ng-required="true">
    </div>

    <!-----------------------任务描述----------------------->
    <div class="form-group">
      <label for="task-description">任务描述</label>
      <textarea class="form-control" id="task-description" focus="false" rows="8" placeholder=" 请输入任务描述" ng-model="taskData.description" ng-required="true" markdown-editor></textarea>
    </div>


    <div class="row">
      <!--------------------------------任务负责人------------------------------>
      <div class="col col-sm-3">
        <handler-selection member-list="candidatedHandlers" handler="handler">
          <label>任务负责人</label>
        </handler-selection>
      </div>

      <div class="col col-sm-5">
        <!-----------------------任务截止日期----------------------->
        <div class="form-group">
          <label for="task-expected-time">任务截止日期</label>
          <div class="row">
            <div class="col-md-12">
              <p class="input-group">
                <input type="text" class="form-control" id="task-expected-time" datepicker-popup="{{datePicker.dateFormat}}" ng-model="datePicker.date" is-open="datePicker.opened" min-date="datePicker.minDate" datepicker-options="datePicker.dateOptions" date-disabled="datePicker.disabled(date, mode)" ng-required="true" close-text="Close" />
                <span class="input-group-btn">
                    <button type="button" class="btn btn-default" ng-click="datePicker.open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
              </p>
            </div>
          </div>
        </div>
      </div>

      <div class="col col-sm-4">
        <!-----------------------任务优先级----------------------->
        <div class="form-group">
          <label for="task-priority">任务优先级</label>
          <div class="row">
            <div class="col-sm-12">
              <select class="form-control" id="task-priority" ng-model="taskData.priority_id" ng-options="priority.id as priority.label for priority in priorityList" ></select>
            </div>
          </div>

        </div>
      </div>
    </div><!--End of div.row-->

    <div class="row">
      <div class="col col-sm-6">
        <!--------------------------添加参与者----------------------->
        <div class="form-group">
          <label>添加参与者</label>
          <member-selection addable-members="projectMembers" selected-members="appointed_member" editable="true"></member-selection>
        </div><!-- End of  添加参与者 -->
      </div>
    </div>







    <!-- 按钮框 -->
    <div class="modal-footer">
      <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
      <button type="submit" class="btn btn-primary" ng-click="ok()" ng-disabled="!taskData.name || !taskData.description || ! projectMembers.length " >确定</button>
    </div>

  </div>
</form>

